package com.cn.qtms.vo;//类注释设置模板

import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.springframework.format.annotation.DateTimeFormat;

import javax.persistence.Column;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;
import java.math.BigDecimal;
import java.util.Date;

/**秒杀商品信息vol类
 * @Name:SecGoodsVo
 * @Description:
 * @Author: zhangyang
 * @Date: 2019-12-30 9:16
 **/
@Data
@NoArgsConstructor
@AllArgsConstructor
public class SecGoodsVo {
    /**
     * 秒杀商品id
     */
    @JsonSerialize(using = ToStringSerializer.class)
    private Long id;
    /**
     * 商品id
     */
    @JsonSerialize(using = ToStringSerializer.class)
    private Long goodsId;
    /**
     * 商品名称
     */
    private String goodsName;
    /**
     * 秒杀场次
     */
    private Integer actType;

    /**
     * 开始时间
     */
    @Temporal(TemporalType.TIMESTAMP)
    @DateTimeFormat(pattern = "HH:mm:ss")
    @JsonFormat(pattern = "HH:mm:ss", timezone = "GMT+8")
    private Date startTime;

    /**
     * 结束时间
     */
    @Temporal(TemporalType.TIMESTAMP)
    @DateTimeFormat(pattern = "HH:mm:ss")
    @JsonFormat(pattern = "HH:mm:ss", timezone = "GMT+8")
    private Date endTime;
    /**
     * 销售价
     */
    private BigDecimal salePrice;
    /**
     * 秒杀价
     */
    private BigDecimal secPrice;
    /**
     * 是否限购
     */
    private Boolean isLimit;
    /**
     * 单次限购次数
     */
    private Integer limitNo;
    /**
     * 最低购买等级
     */
    private Integer minUserLevel;
    /**
     * 剩余数量
     */
    private Integer freeCount;
    /**
     * 总数量
     */
    private Integer eachCount;

    /**
     * 用户等级
     */
    private Integer userLevel;
    /**
     * 已售百分比
     */
    private Integer soldRate;
    /**
     * 是否可以购买 1可以购买 2不能购买
     */
    private Integer canBuy;
}
